// pages/repair/repair.js
const request = require("../../utils/request.js")
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list:[
      {id:1,image:"/starc/img/coffee1.png",title:"咖啡机咖啡机1",text:"未报修",text2:"001",price:"200",price1:"500",button:"我要报修",button1:"删除",show1:'1'},
      {id:2,image:"/starc/img/coffee2.png",title:"咖啡机咖啡机1",text:"报修中",text2:"002",price:"200",price1:"500",button:"确认完成",show2:'1'},
      {id:3,image:"/starc/img/coffee2.png",title:"咖啡机咖啡机1",text:"已完成",text2:"003",price:"200",price1:"500",button:"删除",show3:'1'}
    ],
    list1:[
      {id:1,image:"/starc/img/coffee1.png",title:"咖啡机咖啡机1",text:"未报修",text2:"001",price:"200",price1:"500",button:"我要报修",button1:"删除",show1:'1'},
    ],
    list2:[
      {id:2,image:"/starc/img/coffee2.png",title:"咖啡机咖啡机1",text:"报修中",text2:"002",price:"200",price1:"500",button:"确认完成",show2:'1'},
    ],
    list3:[
      {id:3,image:"/starc/img/coffee2.png",title:"咖啡机咖啡机1",text:"已完成",text2:"003",price:"200",price1:"500",button:"删除",show3:'1'}
    ],
    bxList:''
  },
  jump:function(){
    wx.navigateTo({
     url: '/pages/tijiaorepair/tijiaorepair',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    // 设备报修
    this.getbaoXiu();
  },
  // 设备报修
  getbaoXiu:function () {
    const _this = this
    request.wxRequest('repair/list', function (err, data) {
      if (err) {
        // 失败；
        console.log(err)
      } else {
        console.log(data.data.list)
        _this.setData({
          bxList: data.data.list,
        })
      }
    }, 'GET', {
      
    })
  },
  jump:function(){
    wx.navigateTo({
     url: '/pages/saoyisao/saoyisao',
    })
   },
   jump1:function(){
    wx.navigateTo({
     url: '/pages/tijiaorepair/tijiaorepair',
    })
   },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})